#!/bin/bash



# 安装依赖
install_depend() {
  echo "安装所需的依赖...."
  yum install -y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp curl curl-devel fontconfig fontconfig-devel freetype freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils keyutils-libs-devel krb5-devel libcom_err-devel libpng libpng-devel libjpeg* libsepol-devel libselinux-devel libstdc++-devel libtool* libgomp libxml2 libxml2-devel libXpm* libtiff libtiff* make mpfr ncurses* ntp openssl openssl-devel patch pcre-devel perl php-common php-gd policycoreutils telnet t1lib t1lib* nasm nasm* zlib-devel gd-devel
  echo "安装完成...."
}

# 创建用户和用户组
add_user() {
  groupadd "${2}" && useradd -g "${1}" "${1}" -s /bin/false
  echo "添加了用户:${1}和用户组:${2}"
}

add_path(){
  echo 'export PATH=$PATH:/usr/local/openssl/bin'>>/etc/profile &&
  echo 'export PATH=$PATH:/usr/local/mysql/bin'>>/etc/profile &&
  echo 'export PATH=$PATH:/usr/local/nginx/sbin'>>/etc/profile &&
  echo 'export PATH=$PATH:/usr/local/php/bin'>>/etc/profile &&
  source /etc/profile
}

# 安装依赖
install_depend
# 创建用户和用户组
add_user www www
add_user mysql mysql


